﻿using System.Collections.Generic;
using JTLeigh.Commerce.Spencer.Core.Common;
using JTLeigh.Commerce.Spencer.Features.ProductCatalog.Service.Contracts;
using JTLeigh.Commerce.Spencer.Features.ProductCatalog.Service.Contracts.GetAllCategoryPathsToProduct;

namespace JTLeigh.Commerce.Spencer.Features.ProductFeedback.Business.Mocks
{

	/// <summary>
	/// A mock <see cref="IProductCatalogService"/> implementation that returns hard-coded data for
	/// integration testing purposes.
	/// </summary>
	/// <remarks>
	/// <para>
	/// This class should eventually be removed or moved out of this project.  It's only needed
    /// for integration testing.
	/// </para>
	/// </remarks>
	public class MockProductCatalogService : IProductCatalogService
	{

		#region IProductCatalogService Members

		/// <summary>
		/// Gets all of the category paths to a product.
		/// </summary>
		/// <param name="request">The <see cref="GetAllCategoryPathsToProductRequest"/> request 
		/// object.</param>
		/// <returns>The <see cref="GetAllCategoryPathsToProductResponse"/> response object.</returns>
		/// <remarks>
		/// <para>
		/// A single product can exist in multiple categories and at different levels of the 
		/// hierarchy.
		/// </para>
		/// </remarks>
		public GetAllCategoryPathsToProductResponse GetAllCategoryPathsToProduct(GetAllCategoryPathsToProductRequest request)
		{
			Safety.AssertArgumentNotNull("request", request);

			return new GetAllCategoryPathsToProductResponse
			{
				Paths = new List<CategoryPath>
				{
					new CategoryPath
					{
						Categories = new List<string>
						{
							"ABC", // root
							"DEF",
							"GHI", // product '123' lives here
						}
					},
					new CategoryPath
					{
						Categories = new List<string>
						{
							"ABC", // root
							"JKL",
							"MNO", // product '123' also lives here
						}
					}
				}
			};
		}

		#endregion // IProductCatalogService Members

	}

}
